package training;
// https://www.nowcoder.com/questionTerminal/11cc498832db489786f8a03c3b67d02c
import java.util.ArrayList;
import java.util.Scanner;

public class Day43_01 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int target = scanner.nextInt();
        int curSum = 0;
        ArrayList<Integer> list = new ArrayList<>();
        solution(curSum, 1, list, n, target);
    }
    public static void solution(int curSum, int pos, ArrayList<Integer> list, int n, int target){
        if(curSum >= target){
            if(curSum == target){
                for (int i = 0; i < list.size() - 1; i++) {
                    System.out.print(list.get(i) + " ");
                }
                System.out.println(list.get(list.size()-1));
            }
            return;
        }
        for (int i = pos; i <= n; i++) {
            list.add(i);
            solution(curSum+i, i+1, list, n, target);
            list.remove(list.size()-1);
        }
    }
}
